//
//  Times.swift
//  01-冒泡排序
//
//  Created by XFB on 2020/4/3.
//  Copyright © 2020 XFB. All rights reserved.
//

import Foundation

func executeTime(task: @escaping ()->()) -> CFAbsoluteTime {

    let startTime = CFAbsoluteTimeGetCurrent()
    task()
    let endTime = CFAbsoluteTimeGetCurrent()
    
    return endTime-startTime
}
